package com.itheima.day_08;

import java.util.Scanner;

/*
敏感字替换:字符串替换
使用string replace(ChanSequence target,ChanSequence replacement)方法进行操作
 */
public class Test05 {
    public static void main(String[] args) {
        //键盘录入字符串,用Scanner实现
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入");
        String str = sc.next();
        /*//使用replace()方法进行单种字符的替换
        String tmd = str.replace("tmd", "***");
        //输出替换后的结果
        System.out.println(tmd);*/
        //使用replace()方法进行多种字符的替换
        String[] arr = {"tmd","sb","wc"};
        for (int i = 0; i < arr.length; i++) {
            str = str.replace(arr[i],"**");
        }

        System.out.println(str);
    }
}
